@page "/alertSetting"
@namespace SwashbucklerDiary.Rcl.Pages
@inherits ImportantComponentBase

<MyAppBar Title="@(I18n.T("Setting.Display.Snackbars.Name"))"
          OnClick="NavigateToBack">
</MyAppBar>

<ScrollContainer>
    <MCard Class="my-list-card"
           Elevation="0"
           Rounded="@("lg")">
        <MListItem OnClick="()=>showTimeout=true">
            <MListItemIcon>
                <MIcon Class="evident-icon">
                    mdi-timer-outline
                </MIcon>
            </MListItemIcon>
            <MListItemContent>
                @(I18n.T("Setting.Display.Snackbars.AlertTimeout.Name"))
            </MListItemContent>
            <MListItemContent Class="setting-item-state">
                <MListItemSubtitle>
                    @TimeoutText
                </MListItemSubtitle>
            </MListItemContent>
            <MListItemAction>
                <MIcon>mdi-chevron-right</MIcon>
            </MListItemAction>
        </MListItem>
    </MCard>

    <MCard Class="my-list-card"
           Elevation="0"
           Rounded="@("lg")">
        <MListItem>
            <MListItemIcon>
                <MIcon Class="evident-icon">
                    mdi-trophy-outline
                </MIcon>
            </MListItemIcon>
            <MListItemContent>
                @(I18n.T("Setting.Display.Snackbars.Achievement.Name"))
            </MListItemContent>
            <MListItemAction>
                <SettingSwitch @bind-Value="achievementsAlert"
                               SettingKey="@nameof(Setting.AchievementsAlert)">
                </SettingSwitch>
            </MListItemAction>
        </MListItem>
    </MCard>

</ScrollContainer>

<SelectChipDialog @bind-Visible="showTimeout"
                  @bind-Value="@timeout"
                  @bind-Value:after="UpdateSetting"
                  Title="@(I18n.T("Setting.Display.Snackbars.AlertTimeout.Name"))"
                  Items="timeoutItems"
                  Mandatory="true">
</SelectChipDialog>
